<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <link rel="icon" href="../zymimg/logo.png">
    <title>小说,小说网-纵横中文网|最热门的免费小说网</title>
    <style>
ul{
    width: 1200px;
    display: flex;
    justify-content: space-between;
    box-sizing: border-box;
    margin: auto;
    flex-wrap: wrap;
    padding: 0;
}
li{
    display: flex;
    width: 370px;
    overflow: hidden;
    margin: 0 30px 40px 0;
    box-sizing: border-box;
}
img{
    width: 120px;
    height: 160px;
    display: block;
}
.intro{
    position: relative;
    padding-left: 10px;
}
.title{
    font-size: 16px;
    line-height: 20px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    color: #333;
    width: 234px;
    font-weight: 700;
    margin: 0;
}
.infor{
    font-size: 14px;
    color: #666;
    letter-spacing: 1px;
    line-height: 20px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
}
.button{
    width: 150px;
    height: 36px;
    background: #d32f2f;
    border-radius: 2px;
    color: #fff;
    font-size: 14px;
    line-height: 36px;
    text-align: center;
    letter-spacing: 1px;
    position: absolute;
    left: 10px;
    bottom: 0;
    margin: 0;
}
    </style>
</head>
<body>
    <ul>
        
    </ul>
</body>
<script>
    const ul = document.querySelector('ul');
fetch("https://www.qimao.com/qimaoapi/api/classify/book-list?channel=a&category1=a&category2=a&words=a&update_time=a&is_vip=a&is_over=a&order=click&page=1")
  .then(res => res.json())
  .then(res1 => {
    console.log(res1);
    res1.data.book_list.forEach(function(item) {
      ul.innerHTML += `
        <li>
          <img src="${item.image_link}" 
               alt="${item.book_name}">
          <div class="intro">
            <p class="title">${item.title}</p>
            <p class="infor">${item.intro || '暂无简介'}</p>
            <p class="button">立即阅读</p>
          </div>
        </li>
      `;
    });
  })
  .catch(err => {
    console.log('请求错误:', err);
    ul.innerHTML = '<li>加载失败，请稍后重试</li>';
  });
</script>
</html>